package cn.microven.mindmap.components.part;

import cn.microven.mindmap.components.control.MapTreeItem;
import cn.microven.mindmap.components.line.MapLine;
import cn.microven.mindmap.components.node.AbstractMapNode;
import javafx.beans.binding.NumberBinding;
import javafx.scene.SnapshotParameters;
import javafx.scene.SnapshotResult;
import javafx.scene.control.TreeItem;
import javafx.scene.image.WritableImage;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.util.Callback;

public interface Part {

    /**
     * 添加子节点
     * @param part 子节点
     */
    void addLeaf(Part part);

    void addLeaf();

    /**
     * 删除子节点
     * @param part 子节点
     */
    void removeLeaf(Part part);

    /**
     * 连线
     * @param node 和根节点连线的子节点
     */
    MapLine connectLine(Part node);

    /**
     * 左连接点
     */
    NumberBinding getLeftIntersectionY();

    NumberBinding getRightIntersectionY();

    AbstractMapNode getRoot();

    Part getParentPart();

    void toggleChildrenVisible();

    Pane getLinesBox();

    String getType();

    VBox getVBox();

    void setParentPart(Part parent);

    MapTreeItem getTreeItem();

    LeftMapPart castToLeft();

    RightMapPart castToRight();

    int getLevel();

    void setLevel(int level);

    WritableImage snapshot(SnapshotParameters var1, WritableImage var2);

    public void snapshot(Callback<SnapshotResult, Void> var1, SnapshotParameters var2, WritableImage var3);

    void layout();
}
